<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<input v-model.number="dat" />
			<my-com :dat="dat"></my-com>
		</div>
	</body>
	<script src="vue.js"></script>
	<script>
		
		Vue.component("my-com",{
			//props传递的属性是单向绑定的，子组件中不能修改
			//props数据，
			props:["dat"],
			
			template:"<input v-model.number='dat' />"
		});
		
		var app = new Vue({
			el:"#app",
			data:{
				dat:0
			}
		});
	</script>
</html>

